<style>
.createInfo
{
    margin-left:6px;
}

.createInfo .time
{
    margin-left:6px;
}
</style>
<div class="pageContent">
    <form method="post"
        action="${rc.getContextPath()}/manage/operation/saveOperation"
        class="pageForm required-validate"
        onsubmit="return validateCallback(this, dialogAjaxDone);">
        <div class="pageFormContent" <#if pattern!="add"> layoutH="115" <#else> layoutH="45" </#if> >
            <input type="hidden" name="navTabId" value="${navTabId!''}">
            <input type="hidden" name="id"
                value="<#if (operation.operationCode)??>${operation.operationCode!''}</#if>">
            <fieldset>
                <dl class="nowrap">
                    <dt><@label key="operationCode.C,colon">工序编号：</@label></dt>
                    <dd>
                        <input name="operationCode" value="<#if (operation.operationCode)??>${operation.operationCode!''}</#if>" 
                              size="22" type="text" maxlength="20" class="required  alphanumeric toUp" warn="<@label key='operationCode.C,alreadyExists'>工序编号已存在</@label>"
                              <#if pattern!="add">
                              readonly="readonly"
                              <#else>
                            remote="${rc.getContextPath()}/manage/operation/validateOperationCode"
                             </#if>
                        />
                    </dd>
                </dl>
                <dl class="nowrap">
                    <dt><@label key="operationText.C,colon">工序描述：</@label></dt>
                    <dd>
                        <input name="operationText"
                            value="<#if (operation.operationText)??>${operation.operationText!''}</#if>"
                            size="22" type="text" maxlength="60" class="required" 
                            <#if "read"==pattern>
                              readonly="readonly"
                            </#if>
                          />
                    </dd>
                <dl>
                <dl class="nowrap">
                    <dt><@label key="operationType.C,colon">工序类型：</@label></dt>
                    <dd>
                        <select name="operationTypeEcode"  <#if pattern=="read">disabled="disabled"> </#if> >
                                <#if operationTypeECode??>
                                     <#list operationTypeECode as ECode>
                                            <option value="${ECode.eCode!''}" 
                                            <#if ECode.eCode==operation.operationTypeEcode>
                                                selected="selected"
                                            </#if>
                                            >${ECode.eCodeText!''}</option> 
                                    </#list> 
                                </#if>
                        </select>
                    </dd>
                </dl>
                <dl class="nowrap">
                    <dt><@label key="standardCapacity.C,colon">标准产能</@label></dt>
                    <dd>
                        <input name="standardCapacity"
                            value="<#if (operation.standardCapacity)??>${operation.standardCapacity!''}</#if>"
                            size="22" type="text" class="number" min="1" maxlength="9"
                            <#if "read"==pattern>
                              readonly="readonly"
                            </#if>
                          />
                    </dd>
                <dl>
                <dl class="nowrap">
                    <dt><@label key="standardHours.C,colon">标准用时</@label></dt>
                    <dd>
                        <input name="standardHours"
                            value="<#if (operation.standardHours)??>${operation.standardHours!''}</#if>"
                            size="22" type="text" class="number" min="1" maxlength="9" 
                            <#if "read"==pattern>
                              readonly="readonly"
                            </#if>
                          />
                    </dd>
                <dl>
            </fieldset>
        </div>
        <#if operation??>
            <#assign createInfo=operation>
            <#include "/common/createInfo.html">
        </#if>
        <div class="formBar">
            <ul>
                <#if pattern!="read">
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button name="save" type="submit"><@label key="save.B">保存</@label></button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="buttonActiveGrey">
                            <div class="buttonContent">
                                    <button type="button" class="close"><@label key="cancel.B">取消</@label></button>
                            </div>
                        </div>
                    </li>
                <#else>
                    <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                                <button type="button" class="close"><@label key="close.B">关闭</@label></button>
                        </div>
                    </div>
                </li>
                </#if>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
(function($){
	var page = DWZ.context();
	$("button[name='save']",page).on('click',function(){
		var standardCapacity = $("input[name='standardCapacity'][type='text']",page).val();
		var standardHours = $("input[name='standardHours'][type='text']",page).val();
		
		if(""!=standardCapacity && ""===standardHours){
			alertMsg.error("标准用时不能为空！");
			return false;
		}
		if(""==standardCapacity && ""!=standardHours){
			alertMsg.error("标准产能不能为空！");
			return false;
		}
		$("input[name='pageNum']",page).val("1");
	})
})(jQuery);
</script>
